home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Balloons.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.1 KB  |  291 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Balloons.p
  3.  
  4.      Contains:    Balloon Help Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.0
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Balloons;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __BALLOONS__}
  27. {$SETC __BALLOONS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC BalloonsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __QUICKDRAW__}
  37. {$I Quickdraw.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __MENUS__}
  40. {$I Menus.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __TEXTEDIT__}
  43. {$I TextEdit.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __ERRORS__}
  46. {$I Errors.p}
  47. {$ENDC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54.  
  55. {  • constants }
  56.  
  57.  
  58. CONST
  59.     kTopLeftTipPointsLeftVariant = 0;
  60.     kTopLeftTipPointsUpVariant    = 1;
  61.     kTopRightTipPointsUpVariant    = 2;
  62.     kTopRightTipPointsRightVariant = 3;
  63.     kBottomRightTipPointsRightVariant = 4;
  64.     kBottomRightTipPointsDownVariant = 5;
  65.     kBottomLeftTipPointsDownVariant = 6;
  66.     kBottomLeftTipPointsLeftVariant = 7;
  67.     kBalloonVariantCount        = 8;
  68.  
  69.  
  70. TYPE
  71.     BalloonVariant                        = SInt16;
  72.  
  73. CONST
  74.     hmBalloonHelpVersion        = $0002;                        {  The real version of the Help Manager  }
  75.     kHMHelpMenuID                = -16490;                        {  Resource ID and menu ID of help menu  }
  76.     kHMAboutHelpItem            = 1;                            {  help menu item number of About Balloon Help…  }
  77.     kHMShowBalloonsItem            = 3;                            {  help menu item number of Show/Hide Balloons  }
  78.     kHMHelpID                    = -5696;                        {  ID of various Help Mgr package resources (in Pack14 range)  }
  79.     kBalloonWDEFID                = 126;                            {  Resource ID of the WDEF proc used in standard balloons  }
  80.  
  81.                                                                 {  Dialog item template type constant  }
  82.     helpItem                    = 1;                            {  key value in DITL template that corresponds to the help item  }
  83.  
  84.                                                                 {  Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources  }
  85.     hmDefaultOptions            = 0;                            {  default options for help manager resources  }
  86.     hmUseSubID                    = 1;                            {  treat resID's in resources as subID's of driver base ID (for Desk Accessories)  }
  87.     hmAbsoluteCoords            = 2;                            {  ignore window port origin and treat rectangles as absolute coords (local to window)  }
  88.  
  89.     hmSaveBitsNoWindow            = 4;                            {  don't create a window, just blast bits on screen. No update event is generated  }
  90.     hmSaveBitsWindow            = 8;                            {  create a window, but restore bits behind window when window goes away & generate update event  }
  91.     hmMatchInTitle                = 16;                            {  for hwin resources, match string anywhere in window title string  }
  92.  
  93.                                                                 {  Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources  }
  94.     kHMStringItem                = 1;                            {  pstring used in resource  }
  95.     kHMPictItem                    = 2;                            {  'PICT' ResID used in resource  }
  96.     kHMStringResItem            = 3;                            {  'STR#' ResID & index used in resource  }
  97.     kHMTEResItem                = 6;                            {  Styled Text Edit ResID used in resource ('TEXT' & 'styl')  }
  98.     kHMSTRResItem                = 7;                            {  'STR ' ResID used in resource  }
  99.     kHMSkipItem                    = 256;                            {  don't display a balloon  }
  100.     kHMCompareItem                = 512;                            {  Compare pstring in menu item w/ PString in resource item ('hmnu' only)  }
  101.     kHMNamedResourceItem        = 1024;                            {  Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only)  }
  102.     kHMTrackCntlItem            = 2048;                            {  Reserved  }
  103.  
  104.                                                                 {  Constants for hmmHelpType's when filling out HMMessageRecord  }
  105.     khmmString                    = 1;                            {  help message contains a PString  }
  106.     khmmPict                    = 2;                            {  help message contains a resource ID to a 'PICT' resource  }
  107.     khmmStringRes                = 3;                            {  help message contains a res ID & index to a 'STR#' resource  }
  108.     khmmTEHandle                = 4;                            {  help message contains a Text Edit handle  }
  109.     khmmPictHandle                = 5;                            {  help message contains a Picture handle  }
  110.     khmmTERes                    = 6;                            {  help message contains a res ID to 'TEXT' & 'styl' resources  }
  111.     khmmSTRRes                    = 7;                            {  help message contains a res ID to a 'STR ' resource  }
  112.     kHMEnabledItem                = 0;                            {  item is enabled, but not checked or control value = 0  }
  113.  
  114.                                                                 {  ResTypes for Styled TE Handles in Resources  }
  115.     kHMTETextResType            = 'TEXT';                        {  Resource Type of text data for styled TE record w/o style info  }
  116.     kHMTEStyleResType            = 'styl';                        {  Resource Type of style information for styled TE record  }
  117.  
  118.     kHMDisabledItem                = 1;                            {  item is disabled, grayed in menus or disabled in dialogs  }
  119.     kHMCheckedItem                = 2;                            {  item is enabled, and checked or control value = 1  }
  120.     kHMOtherItem                = 3;                            {  item is enabled, and control value > 1  }
  121.                                                                 {  Method parameters to pass to HMShowBalloon  }
  122.     kHMRegularWindow            = 0;                            {  Create a regular window floating above all windows  }
  123.     kHMSaveBitsNoWindow            = 1;                            {  Just save the bits and draw (for MDEF calls)  }
  124.     kHMSaveBitsWindow            = 2;                            {  Regular window, save bits behind, AND generate update event  }
  125.  
  126.                                                                 {  Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages  }
  127.     kHMMenuResType                = 'hmnu';                        {  ResType of help resource for supporting menus  }
  128.     kHMDialogResType            = 'hdlg';                        {  ResType of help resource for supporting dialogs  }
  129.     kHMWindListResType            = 'hwin';                        {  ResType of help resource for supporting windows  }
  130.     kHMRectListResType            = 'hrct';                        {  ResType of help resource for rectangles in windows  }
  131.     kHMOverrideResType            = 'hovr';                        {  ResType of help resource for overriding system balloons  }
  132.     kHMFinderApplResType        = 'hfdr';                        {  ResType of help resource for custom balloon in Finder  }
  133.  
  134.  
  135. TYPE
  136.     HMStringResTypePtr = ^HMStringResType;
  137.     HMStringResType = RECORD
  138.         hmmResID:                INTEGER;
  139.         hmmIndex:                INTEGER;
  140.     END;
  141.  
  142.     HMMessageRecordPtr = ^HMMessageRecord;
  143.     HMMessageRecord = RECORD
  144.         hmmHelpType:            SInt16;
  145.         CASE INTEGER OF
  146.         0: (
  147.             hmmString:            Str255;
  148.             );
  149.         1: (
  150.             hmmPict:            SInt16;
  151.             );
  152.         2: (
  153.             hmmTEHandle:        TEHandle;
  154.             );
  155.         3: (
  156.             hmmStringRes:        HMStringResType;
  157.             );
  158.         4: (
  159.             hmmPictRes:            SInt16;
  160.             );
  161.         5: (
  162.             hmmPictHandle:        PicHandle;
  163.             );
  164.         6: (
  165.             hmmTERes:            SInt16;
  166.             );
  167.         7: (
  168.             hmmSTRRes:            SInt16;
  169.             );
  170.     END;
  171.  
  172.     HMMessageRecPtr                        = ^HMMessageRecord;
  173. {$IFC TYPED_FUNCTION_POINTERS}
  174.     TipFunctionProcPtr = FUNCTION(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: BalloonVariant): OSErr;
  175. {$ELSEC}
  176.     TipFunctionProcPtr = ProcPtr;
  177. {$ENDC}
  178.  
  179.     TipFunctionUPP = UniversalProcPtr;
  180.  
  181. CONST
  182.     uppTipFunctionProcInfo = $00003FE0;
  183.  
  184. FUNCTION NewTipFunctionProc(userRoutine: TipFunctionProcPtr): TipFunctionUPP;
  185.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  186.     INLINE $2E9F;
  187.     {$ENDC}
  188.  
  189. FUNCTION CallTipFunctionProc(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: BalloonVariant; userRoutine: TipFunctionUPP): OSErr;
  190.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  191.     INLINE $205F, $4E90;
  192.     {$ENDC}
  193. {  Public Interfaces  }
  194. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuHandle): OSErr;
  195.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  196.     INLINE $303C, $0200, $A830;
  197.     {$ENDC}
  198. FUNCTION HMShowBalloon({CONST}VAR inHelpMessage: HMMessageRecord; inTip: Point; inHotRect: RectPtr; inTipProc: TipFunctionUPP; inWindowProcID: SInt16; inBalloonVariant: BalloonVariant; inMethod: SInt16): OSErr;
  199.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  200.     INLINE $303C, $0B01, $A830;
  201.     {$ENDC}
  202. FUNCTION HMShowMenuBalloon(itemNum: SInt16; itemMenuID: SInt16; itemFlags: SInt32; itemReserved: SInt32; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: BalloonVariant): OSErr;
  203.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  204.     INLINE $303C, $0E05, $A830;
  205.     {$ENDC}
  206. FUNCTION HMRemoveBalloon: OSErr;
  207.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  208.     INLINE $303C, $0002, $A830;
  209.     {$ENDC}
  210. FUNCTION HMGetIndHelpMsg(inWhichResType: ResType; inWhichResID: SInt16; inMessageIndex: SInt16; inMessageState: SInt16; VAR outOptions: UInt32; VAR outTip: Point; VAR outHotRect: Rect; VAR outWindowProcID: SInt16; VAR outBalloonVariant: BalloonVariant; VAR outHelpMessage: HMMessageRecord; VAR outMessageCount: SInt16): OSErr;
  211.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  212.     INLINE $303C, $1306, $A830;
  213.     {$ENDC}
  214. FUNCTION HMIsBalloon: BOOLEAN;
  215.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  216.     INLINE $303C, $0007, $A830;
  217.     {$ENDC}
  218. FUNCTION HMGetBalloons: BOOLEAN;
  219.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  220.     INLINE $303C, $0003, $A830;
  221.     {$ENDC}
  222. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  223.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  224.     INLINE $303C, $0104, $A830;
  225.     {$ENDC}
  226. FUNCTION HMSetFont(font: SInt16): OSErr;
  227.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  228.     INLINE $303C, $0108, $A830;
  229.     {$ENDC}
  230. FUNCTION HMSetFontSize(fontSize: UInt16): OSErr;
  231.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  232.     INLINE $303C, $0109, $A830;
  233.     {$ENDC}
  234. FUNCTION HMGetFont(VAR font: SInt16): OSErr;
  235.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  236.     INLINE $303C, $020A, $A830;
  237.     {$ENDC}
  238. FUNCTION HMGetFontSize(VAR fontSize: UInt16): OSErr;
  239.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  240.     INLINE $303C, $020B, $A830;
  241.     {$ENDC}
  242. FUNCTION HMSetDialogResID(resID: SInt16): OSErr;
  243.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  244.     INLINE $303C, $010C, $A830;
  245.     {$ENDC}
  246. FUNCTION HMSetMenuResID(menuID: SInt16; resID: SInt16): OSErr;
  247.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  248.     INLINE $303C, $020D, $A830;
  249.     {$ENDC}
  250. FUNCTION HMBalloonRect({CONST}VAR inMessage: HMMessageRecord; VAR outRect: Rect): OSErr;
  251.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  252.     INLINE $303C, $040E, $A830;
  253.     {$ENDC}
  254. FUNCTION HMBalloonPict({CONST}VAR inMessage: HMMessageRecord; VAR outPict: PicHandle): OSErr;
  255.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  256.     INLINE $303C, $040F, $A830;
  257.     {$ENDC}
  258. FUNCTION HMScanTemplateItems(whichID: SInt16; whichResFile: SInt16; whichType: ResType): OSErr;
  259.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  260.     INLINE $303C, $0410, $A830;
  261.     {$ENDC}
  262. FUNCTION HMExtractHelpMsg(inType: ResType; inResID: SInt16; inMessageIndex: SInt16; inMessageState: SInt16; VAR outMessage: HMMessageRecord): OSErr;
  263.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  264.     INLINE $303C, $0711, $A830;
  265.     {$ENDC}
  266. FUNCTION HMGetDialogResID(VAR resID: SInt16): OSErr;
  267.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  268.     INLINE $303C, $0213, $A830;
  269.     {$ENDC}
  270. FUNCTION HMGetMenuResID(menuID: SInt16; VAR resID: SInt16): OSErr;
  271.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  272.     INLINE $303C, $0314, $A830;
  273.     {$ENDC}
  274. FUNCTION HMGetBalloonWindow(VAR window: WindowPtr): OSErr;
  275.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  276.     INLINE $303C, $0215, $A830;
  277.     {$ENDC}
  278.  
  279.  
  280.  
  281. {$ALIGN RESET}
  282. {$POP}
  283.  
  284. {$SETC UsingIncludes := BalloonsIncludes}
  285.  
  286. {$ENDC} {__BALLOONS__}
  287.  
  288. {$IFC NOT UsingIncludes}
  289.  END.
  290. {$ENDC}
  291.